# (c) 2008 by BogDan Vatra < bogdan@licentia.eu >

project(lansatoru)

include_directories(BEFORE "${CMAKE_SOURCE_DIR}/libs")

set(lansatorul_SRCS main.cpp lansatorul.cpp)
QT4_WRAP_CPP(lansatorul_SRCS lansatorul.h)
QT4_ADD_RESOURCES(lansatorul_SRCS lansatorul.qrc)

if(WIN32)
  if(MINGW)
    # resource compilation for mingw
    ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lansatorul_rc.o
                       COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR}
                                           -i${CMAKE_CURRENT_SOURCE_DIR}/lansatorul.rc
                                           -o ${CMAKE_CURRENT_BINARY_DIR}/lansatorul_rc.o)
    SET(lansatorul_SRCS ${lansatorul_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/lansatorul_rc.o)
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
  else(MINGW)
    SET(lansatorul_SRCS ${lansatorul_SRCS} lansatorul.rc)
  endif(MINGW)
endif(WIN32)

add_executable(lansatorul ${lansatorul_SRCS})
link_directories( "${CMAKE_SOURCE_DIR}/libs" )
target_link_libraries(lansatorul ${QT_LIBRARIES})

install(TARGETS lansatorul DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)
